<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

  <style>
    body {
      margin: 0;
      display: flex;
      height: 100vh;
      justify-content: center;
      align-items: center;
    }

    .container {
      max-width: 1000px;
      position: relative;
      display: flex;
      justify-content: center;
      flex-wrap: wrap;
      transform-style: preserve-3d;
    }

    .container:hover .card {
      transform: perspective(500px) rotateY(30deg);
    }

    .container .card:hover {
      transform: perspective(500px) rotateY(0deg);
    }
    .container .card:hover ~ .card {
      transform: perspective(500px) rotateY(-30deg);
    }

    .container .card {
      position: relative;
      width: 180px;
      height: 240px;
      background-color: #fff;
      margin: 0 10px;
      display: flex;
      justify-content: center;
      align-items: center;
      border-radius: 4px;
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
      transition: 0.5s;
      overflow: hidden;
      transform-style: preserve-3d;
    }

    .container .card h2 {
      width: 80px;
      height: 80px;
      line-height: 80px;
      font-size: 3em;
      background: #2196f3;
      color: #fff;
      text-align: center;
      border-radius: 50%;
      transition: box-shadow 0.5s;
    }

    .container .card:hover h2 {
      background-color: #fff;
      color: #2196f3;
      box-shadow: 0 0 0 150px #2196f3;
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="card">
      <h2>1</h2>
    </div>
    <div class="card">
      <h2>2</h2>
    </div>
    <div class="card">
      <h2>3</h2>
    </div>
  </div>
</body>

</html>